package com.hadwinling.blog.util;

import com.baidu.aip.contentcensor.EImgType;
import org.json.JSONObject;

import java.io.IOException;

/**
 * @Author: Yorika
 * @Date: 2020/6/12 13:43
 */

//百度文字/图像审核接口
public class Baiducensor {
    //文本审核
    public static JSONObject textCheck(String text){
        JSONObject response=Baiducensorconfig.client.textCensorUserDefined(text);
        System.out.println(response.toString());
        return response;
    }

    //图片审核
    public static JSONObject imgCheck(String url) throws IOException {
        JSONObject response=Baiducensorconfig.client.imageCensorUserDefined(url, EImgType.URL,null);
        System.out.println(response.toString());
        return response;
    }
}